# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=shellinabox
pkgver=v2.21.r0.g4f0ecc3
pkgrel=1
epoch=1
pkgdesc='Implements a web server that can export arbitrary command line tools to a web based terminal emulator.'
groups=('blackarch' 'blackarch-backdoor' 'blackarch-webapp')
arch=('x86_64' 'aarch64')
url='https://github.com/shellinabox/shellinabox'
license=('GPL-2.0-only')
depends=('openssl-1.0' 'zlib')
makedepends=('git' 'autoconf')
source=("git+https://github.com/shellinabox/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd $pkgname

  unset CPPFLAGS
  autoreconf -i
  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install
}

